const mysql2 = require('mysql2');

const connection = mysql2.createConnection({
  host: 'localhost',
  user: 'root',
  password: 'root',
  database: 'test'
})

module.exports = {
  async getData() {
    let [rows] = await connection.promise().query('SELECT * FROM users');
    return rows;
  }
}